##
#   Project: gmediacatalog - Catalog your media to find them later
#    Author: Fabio Castelli <muflone@vbsimple.net>
# Copyright: 2010 Fabio Castelli
#   License: GPL-2+
#  This program is free software; you can redistribute it and/or modify it
#  under the terms of the GNU General Public License as published by the Free
#  Software Foundation; either version 2 of the License, or (at your option)
#  any later version.
# 
#  This program is distributed in the hope that it will be useful, but WITHOUT
#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
#  more details.
# 
# On Debian GNU/Linux systems, the full text of the GNU General Public License
# can be found in the file /usr/share/common-licenses/GPL-2.
##

PLUGIN_NAME = 'Debug'
PLUGIN_VERSION = '0.1'
PLUGIN_DESCRIPTION = 'Debug interface'
PLUGIN_AUTHOR = 'Fabio Castelli'

from plugins import GMediaCatalogPlugin, register_plugin

class GMediaCatalogPlugin_Debug(GMediaCatalogPlugin):
  def __init__(self, name, version, description, author):
    "Module initialization"
    GMediaCatalogPlugin.__init__(self, name, version, description, author)
    self.logger('__init__("%s", "%s", "%s", "%s")' % (
      PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR, PLUGIN_DESCRIPTION))
    self.active = False

  def load(self):
    "Plugin load"
    GMediaCatalogPlugin.load(self)
    self.logger('load()')
  
  def unload(self):
    "Plugin unload"
    GMediaCatalogPlugin.unload(self)
    self.logger('unload()')
  
  def reload(self):
    "Plugin reload"
    GMediaCatalogPlugin.reload(self)
    self.logger('reload()')

  def configure(self):
    "Plugin custom configuration"
    GMediaCatalogPlugin.configure(self)
    self.logger('configure()')

  def update_ui(self):
    "Update UI for changes"
    GMediaCatalogPlugin.update_ui(self)
    self.logger('update_ui()')
  
  def on_uiready(self, ui, connection):
    self.logger('on_uiready(%s, %s)' % (ui, connection))

  def on_closing(self):
    self.logger('on_closing()')

  def on_closed(self):
    self.logger('on_closed()')

  def on_terminate(self):
    self.logger('on_terminate()')

  def on_before_new_volume(self):
    self.logger('on_before_new_volume()')

  def on_new_volume(self, name, description, fVolume):
    self.logger('on_new_volume("%s", "%s", %s)' % (name, description, fVolume))

  def on_after_new_volume(self, volume_id):
    self.logger('on_after_new_volume(%d)' % volume_id)

  def on_before_new_path(self):
    self.logger('on_before_new_path()')

  def on_new_path(self, volume_id, fFolder):
    self.logger('on_new_path(%d, %s)' % (volume_id, fFolder))

  def on_after_new_path(self, path_id):
    self.logger('on_after_new_path(%d)' % path_id)

  def on_before_new_file(self):
    self.logger('on_before_new_file()')

  def on_new_file(self, volume_id, folder_id, child, info, category_id):
    self.logger('on_new_file(%d, %d, %s, %s, %d)' % (
      volume_id, folder_id, child, info, category_id))

  def on_after_new_file(self, file_id):
    self.logger('on_after_new_file(%d)' % file_id)

  def on_delete_volume(self, volume_id):
    self.logger('on_delete_volume(%d)' % volume_id)

plugin = GMediaCatalogPlugin_Debug(
  PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_DESCRIPTION, 
  PLUGIN_AUTHOR)
register_plugin(PLUGIN_NAME, plugin)
